A flat file database places structured data into a single file. This file can be human-readable text or encoded as a binary or other machine readable format. Generally, the database file will consist of a table made up of columns and rows with each row containing a single database record and each column representing a specific field contained by each record. These columnar fields can be delimited with a character (usually a comma or a space), separated by a [tab] or can be of a specified fixed width. In the latter case, the file is likely to contain padding (extra spaces) between some or all fields.
Here are some examples:
Comma delimited
Last Name, First Name, Middle Name, Course Number
Zelnick, Nate, Thomas, ED565
Doe, John, D., ED565
Space Delimited Note that column names and enclosed in "quotation marks" because each name has a space in it as well as a space between the columns. Enclosing the column names in either 'single quotes' or "double quotes" ensures that parsing is done correctly.
"Last Name" "First Name" "Middle Name" "Course Number"
Zelnick Nate Thomas ED565
Doe John D. ED565
Tab Delimited Last NameFirst NameMiddle NameCourse NumberZelnickNateThomasED565DoeJohnD.ED565
Fixed Width
Last Name First Name Middle Name Course NumberZelnick Nate Thomas ED565Doe John D. ED565
Flat File
A flat file database places structured data into a single file. This file can be human-readable text or encoded as a binary or other machine readable format. Generally, the database file will consist of a table made up of columns and rows with each row containing a single database record and each column representing a specific field contained by each record. These columnar fields can be delimited with a character (usually a comma or a space), separated by a [tab] or can be of a specified fixed width. In the latter case, the file is likely to contain padding (extra spaces) between some or all fields.
Here are some examples:
Comma delimited
Last Name, First Name, Middle Name, Course Number
Zelnick, Nate, Thomas, ED565
Doe, John, D., ED565
Space Delimited
Note that column names and enclosed in "quotation marks" because each name has a space in it as well as a space between the columns. Enclosing the column names in either 'single quotes' or "double quotes" ensures that parsing is done correctly.
"Last Name" "First Name" "Middle Name" "Course Number"
Zelnick Nate Thomas ED565
Doe John D. ED565
Tab Delimited
Last Name First Name Middle Name Course NumberZelnick Nate Thomas ED565Doe John D. ED565
Fixed Width
Last Name First Name Middle Name Course NumberZelnick Nate Thomas ED565Doe John D. ED565